home *** CD-ROM | disk | FTP | other *** search
- Path: ulkyvx.louisville.edu!gclind01
- From: gclind01@ulkyvx.louisville.edu
- Newsgroups: comp.sys.m68k
- Subject: Re: M68K asm beginner with a problem
- Date: 2 Jan 96 07:03:48 EDT
- Organization: University of Louisville
- Message-ID: <1996Jan2.070348.1@ulkyvx.louisville.edu>
- References: <30e88c51.9635879@nntp.ibmpcug.co.uk>
- NNTP-Posting-Host: ulkyvx.louisville.edu
-
- In article <30e88c51.9635879@nntp.ibmpcug.co.uk>, simon@epsilon.win-uk.net (Simon Ho) writes:
- > Hi
- >
- > I trying my hand at assembly language on the m68k cpu. I am trying to
- > program a small program to set up a list using dc.w command (for some
- > insert/delete routines later) but aren't quite sure how to implement
- > it.
- >
- > To clarify, I have a list of values. I want to set up an 'array'
- > with the value and an address pointer to the next value. Ideally, I
- > would SECT this so that it can go in any available part of memory.
- >
- > Do I have to set up loads of move.w commands?
- >
- > Do I just
- >
- > dc.w. $200, 3, $202, 4, etc ?
- >
- > or what?
- >
- > This should allow me to program a routine to insert a value at the end
- > of the array but with the pointer of the next lowest number pointing
- > to that value and then have the pointer associated with that value
- > pooint to the next highest value.
-
- Your problem is that you want to program in the links at assemble time,
- [B but you don't know
- the address the program is going to be loaded so you don't know what
- numbers to choose for the links.
-
-
- The easy way is, start with a link of 4 and use 8 for the next link and
- so on. Then when the program is loaded and you figure out where the
- data is going to be you write a loop to fix all the links. For example
- if the links come first and then the data:
-
-
- addr dc.w 4,5,8,7,12,20,16,21,0,23
-
- Here the 0 indicates there are no further links. Then in the program
- you add 'addr' to each of the links at run-time (you can write it in
- a loop) and you are set to go
- >
- > TIA
- >
- > Simon
- --
- David Lindauer - gclind01@ulkyvx.louisville.edu
- - Theropod for 68K series
- ftp: ftp.std.com://pub/os-code
-